import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/pxx-store/store/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/pxx-store/store/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/pxx-store/store/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/pxx-store/store/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/pxx-store/store/submit',
    method: 'post',
    data: row
  })
}

export const updateApproval = (row) => {
  return request({
    url: '/api/pxx-store/store/updateApproval',
    method: 'post',
    data: row
  })
}

export const joinStore = (store) => {
  return request({
    url: '/api/pxx-store/store/joinStore',
    method: 'post',
    data: store
  })
}

export const approvalMessage = () => {
  return request({
    url: '/api/pxx-store/store/approvalMessage',
    method: 'get',
  })
}

export const getStoreDetail = (loginId) => {
  return request({
    url: '/api/pxx-store/store/detail',
    method: 'get',
    params: {
      loginId
    }
  })
}
